package gnss

const (
	GNSS_SV_SIG_MIN_ID = 1
	GNSS_SV_SIG_MAX_ID = 32

	GNSS_SV_MAX_SYS = 8

	// 频点定义 参考 Rinex文档进行定义, 可以调整数字
	// BDS
	// B1 / 1561.098 (BDS-2/3 Signals)
	GNSS_SV_SIG_BDS_B1_2I = 1 //  (B1I signal)
	GNSS_SV_SIG_BDS_B1_2Q = 2
	GNSS_SV_SIG_BDS_B1_2X = 3

	// B3/1268.52 (BDS-2/3 Signals)
	GNSS_SV_SIG_BDS_B3_6I = 4
	GNSS_SV_SIG_BDS_B3_6Q = 5
	GNSS_SV_SIG_BDS_B3_6X = 6

	// B2 / 1207.140 (BDS-2 Signals)
	GNSS_SV_SIG_BDS_B2_7I = 7 //  (B2I signal)
	GNSS_SV_SIG_BDS_B2_7Q = 8
	GNSS_SV_SIG_BDS_B2_7X = 9

	// B2a / 1176.45 (BDS-3 Signals)
	GNSS_SV_SIG_BDS_B2a_5D = 10
	GNSS_SV_SIG_BDS_B2a_5P = 11
	GNSS_SV_SIG_BDS_B2a_5X = 12

	// B2b / 1207.140 (BDS-3 Signals)
	GNSS_SV_SIG_BDS_B2b_7D = 13
	GNSS_SV_SIG_BDS_B2b_7P = 14
	GNSS_SV_SIG_BDS_B2b_7Z = 15

	// B2(B2a+B2b)/1191.795 (BDS-3 Signals)
	GNSS_SV_SIG_BDS_B2ab_8D = 16
	GNSS_SV_SIG_BDS_B2ab_8P = 17
	GNSS_SV_SIG_BDS_B2ab_8X = 18

	// B1A / 1575.42 (BDS-3 Signals)
	GNSS_SV_SIG_BDS_B1A_1S = 26
	GNSS_SV_SIG_BDS_B1A_1L = 27
	GNSS_SV_SIG_BDS_B1A_1Z = 28

	//B1C / 1575.42 (BDS-3 Signals)
	GNSS_SV_SIG_BDS_B1C_1D = 29
	GNSS_SV_SIG_BDS_B1C_1P = 30
	GNSS_SV_SIG_BDS_B1C_1X = 31

	// B3A / 1268.52 (BDS-3 Signals)
	GNSS_SV_SIG_BDS_B3A_6D = 19
	GNSS_SV_SIG_BDS_B3A_6P = 20
	GNSS_SV_SIG_BDS_B3A_6Z = 21

	// GPS
	// L1/1575.42
	GNSS_SV_SIG_GPS_L1_1C = 1
	GNSS_SV_SIG_GPS_L1_1S = 2
	GNSS_SV_SIG_GPS_L1_1L = 3
	GNSS_SV_SIG_GPS_L1_1X = 4
	GNSS_SV_SIG_GPS_L1_1P = 5
	GNSS_SV_SIG_GPS_L1_1W = 6
	GNSS_SV_SIG_GPS_L1_1Y = 7
	GNSS_SV_SIG_GPS_L1_1M = 8
	GNSS_SV_SIG_GPS_L1_1N = 9

	// L2/1227.60
	GNSS_SV_SIG_GPS_L2_2C = 11
	GNSS_SV_SIG_GPS_L2_2W = 12
	GNSS_SV_SIG_GPS_L2_2L = 13
	GNSS_SV_SIG_GPS_L2_2X = 14
	GNSS_SV_SIG_GPS_L2_2P = 15
	GNSS_SV_SIG_GPS_L2_2S = 16
	GNSS_SV_SIG_GPS_L2_2Y = 17
	GNSS_SV_SIG_GPS_L2_2M = 18
	GNSS_SV_SIG_GPS_L2_2N = 19

	// L5/1176.45
	GNSS_SV_SIG_GPS_L5_5I = 21
	GNSS_SV_SIG_GPS_L5_5Q = 22
	GNSS_SV_SIG_GPS_L5_5X = 23

	// GLONASS
	// G1 1602+k*9/16 (k= -7….+12)
	GNSS_SV_SIG_GLO_G1_1C = 1
	GNSS_SV_SIG_GLO_G1_1P = 2

	// G1a/  1600.995
	GNSS_SV_SIG_GLO_G1a_4A = 3
	GNSS_SV_SIG_GLO_G1a_4B = 4
	GNSS_SV_SIG_GLO_G1a_4X = 5

	// G2 G2/ 1246+k*7/16
	GNSS_SV_SIG_GLO_G2_2C = 11
	GNSS_SV_SIG_GLO_G2_2P = 12

	// G2a/  1248.06
	GNSS_SV_SIG_GLO_G2a_6A = 13
	GNSS_SV_SIG_GLO_G2a_6B = 14
	GNSS_SV_SIG_GLO_G2a_6X = 15

	// G3 / 1202.025
	GNSS_SV_SIG_GLO_G3_3I = 21
	GNSS_SV_SIG_GLO_G3_3Q = 22
	GNSS_SV_SIG_GLO_G3_3X = 23

	// Galileo
	// E1 / 1575.42
	GNSS_SV_SIG_GAL_E1_1A = 1
	GNSS_SV_SIG_GAL_E1_1B = 2
	GNSS_SV_SIG_GAL_E1_1C = 3
	GNSS_SV_SIG_GAL_E1_1X = 4
	GNSS_SV_SIG_GAL_E1_1Z = 5

	// E5a / 1176.45
	GNSS_SV_SIG_GAL_E5a_5I = 6
	GNSS_SV_SIG_GAL_E5a_5Q = 7
	GNSS_SV_SIG_GAL_E5a_5X = 8

	// E5b / 1207.140
	GNSS_SV_SIG_GAL_E5b_7I = 9
	GNSS_SV_SIG_GAL_E5b_7Q = 10
	GNSS_SV_SIG_GAL_E5b_7X = 11

	// E5(E5a+E5b) /  1191.795
	GNSS_SV_SIG_GAL_E5ab_8I = 12
	GNSS_SV_SIG_GAL_E5ab_8Q = 13
	GNSS_SV_SIG_GAL_E5ab_8X = 14

	// E6 / 1278.75
	GNSS_SV_SIG_GAL_E6_6A = 21
	GNSS_SV_SIG_GAL_E6_6B = 22
	GNSS_SV_SIG_GAL_E6_6C = 23
	GNSS_SV_SIG_GAL_E6_6X = 24
	GNSS_SV_SIG_GAL_E6_6Z = 25

	// SBAS
	// L1 / 1575.42
	GNSS_SV_SIG_SBAS_L1_1C = 1

	// L5 / 1176.45
	GNSS_SV_SIG_SBAS_L5_5I = 21
	GNSS_SV_SIG_SBAS_L5_5Q = 22
	GNSS_SV_SIG_SBAS_L5_5X = 23

	// QZSS
	// L1/1575.42
	GNSS_SV_SIG_QZS_L1_1C = 1
	GNSS_SV_SIG_QZS_L1_1E = 2
	GNSS_SV_SIG_QZS_L1_1S = 3
	GNSS_SV_SIG_QZS_L1_1L = 4
	GNSS_SV_SIG_QZS_L1_1X = 5
	GNSS_SV_SIG_QZS_L1_1Z = 6
	GNSS_SV_SIG_QZS_L1_1B = 7

	// L2/1227.60
	GNSS_SV_SIG_QZS_L2_2S = 12
	GNSS_SV_SIG_QZS_L2_2L = 13
	GNSS_SV_SIG_QZS_L2_2X = 14

	// L5/1176.45
	GNSS_SV_SIG_QZS_L5_5I = 21 // Block I+II Signals
	GNSS_SV_SIG_QZS_L5_5Q = 22 // Block I+II Signals
	GNSS_SV_SIG_QZS_L5_5X = 23 // Block I+II Signals
	GNSS_SV_SIG_QZS_L5_5D = 24 // Block II L5S Signals
	GNSS_SV_SIG_QZS_L5_5P = 25 // Block II L5S Signals
	GNSS_SV_SIG_QZS_L5_5Z = 26 // Block II L5S Signals

	// L6 / 1278.75
	GNSS_SV_SIG_QZS_L6_6S = 27 // Block I LEX Signals , Block II Signals
	GNSS_SV_SIG_QZS_L6_6L = 28 // Block I LEX Signals
	GNSS_SV_SIG_QZS_L6_6X = 29 // Block I LEX Signals
	GNSS_SV_SIG_QZS_L6_6E = 30 // Block II Signals
	GNSS_SV_SIG_QZS_L6_6Z = 31 // Block II Signals

	// BDS
	GNSS_SV_FREQ_BDS_B1   = 1561.098 //  (B1I signal)
	GNSS_SV_FREQ_BDS_B3   = 1268.52
	GNSS_SV_FREQ_BDS_B2   = 1207.140 //  (B2I signal)
	GNSS_SV_FREQ_BDS_B2a  = 1176.45
	GNSS_SV_FREQ_BDS_B2b  = 1207.140
	GNSS_SV_FREQ_BDS_B2ab = 1191.795
	GNSS_SV_FREQ_BDS_B1A  = 1575.42
	GNSS_SV_FREQ_BDS_B1C  = 1575.42
	GNSS_SV_FREQ_BDS_B3A  = 1268.52

	// GPS
	GNSS_SV_FREQ_GPS_L1 = 1575.42
	GNSS_SV_FREQ_GPS_L2 = 1227.60
	GNSS_SV_FREQ_GPS_L5 = 1176.45

	// GLONASS

	GNSS_SV_FREQ_GLO_G1  = 1602 // G1 1602+k*9/16 (k= -7….+12)
	GNSS_SV_FREQ_GLO_G1a = 1600.995
	GNSS_SV_FREQ_GLO_G2  = 1246 //G2 G2/ 1246+k*7/16
	GNSS_SV_FREQ_GLO_G2a = 1248.06

	// G3 / 1202.025
	GNSS_SV_FREQ_GLO_G3 = 1202.025

	// Galileo
	GNSS_SV_FREQ_GAL_E1   = 1575.42
	GNSS_SV_FREQ_GAL_E5a  = 1176.45
	GNSS_SV_FREQ_GAL_E5b  = 1207.140
	GNSS_SV_FREQ_GAL_E5ab = 1191.795
	GNSS_SV_FREQ_GAL_E6   = 1278.75

	// SBAS
	GNSS_SV_FREQ_SBAS_L1 = 1575.42
	GNSS_SV_FREQ_SBAS_L5 = 1176.45

	// QZSS
	GNSS_SV_FREQ_QZS_L1 = 1575.42
	GNSS_SV_FREQ_QZS_L2 = 1227.60
	GNSS_SV_FREQ_QZS_L5 = 1176.45
	GNSS_SV_FREQ_QZS_L6 = 1278.75 // Block I LEX Signals , Block II Signals

	// 低轨卫星
	GNSS_SV_SIG_WLNAV_L1_1I = 1
	GNSS_SV_SIG_WLNAV_L1_1Q = 2
	GNSS_SV_SIG_WLNAV_L1_1X = 3

	GNSS_SV_SIG_WLNAV_L5_5I = 4
	GNSS_SV_SIG_WLNAV_L5_5Q = 5
	GNSS_SV_SIG_WLNAV_L5_5X = 6
)

func GnssSvBDSSigId2Code(sigid byte) (code string) {
	switch sigid {
	case GNSS_SV_SIG_BDS_B1_2I:
		code = "2I"
	case GNSS_SV_SIG_BDS_B1_2Q:
		code = "2Q"
	case GNSS_SV_SIG_BDS_B1_2X:
		code = "2X"

	case GNSS_SV_SIG_BDS_B1C_1D:
		code = "1D"
	case GNSS_SV_SIG_BDS_B1C_1P:
		code = "1P"
	case GNSS_SV_SIG_BDS_B1C_1X:
		code = "1X"

	case GNSS_SV_SIG_BDS_B1A_1S:
		code = "1S"
	case GNSS_SV_SIG_BDS_B1A_1L:
		code = "1L"
	case GNSS_SV_SIG_BDS_B1A_1Z:
		code = "1Z"

	case GNSS_SV_SIG_BDS_B2a_5D:
		code = "5D"
	case GNSS_SV_SIG_BDS_B2a_5P:
		code = "5P"
	case GNSS_SV_SIG_BDS_B2a_5X:
		code = "5X"

	case GNSS_SV_SIG_BDS_B2_7I:
		code = "7I"
	case GNSS_SV_SIG_BDS_B2_7Q:
		code = "7Q"
	case GNSS_SV_SIG_BDS_B2_7X:
		code = "7X"

	case GNSS_SV_SIG_BDS_B2b_7D:
		code = "7D"
	case GNSS_SV_SIG_BDS_B2b_7P:
		code = "7P"
	case GNSS_SV_SIG_BDS_B2b_7Z:
		code = "7Z"

	case GNSS_SV_SIG_BDS_B2ab_8D:
		code = "8D"
	case GNSS_SV_SIG_BDS_B2ab_8P:
		code = "8P"
	case GNSS_SV_SIG_BDS_B2ab_8X:
		code = "8X"

	case GNSS_SV_SIG_BDS_B3_6I:
		code = "6I"
	case GNSS_SV_SIG_BDS_B3_6Q:
		code = "6Q"
	case GNSS_SV_SIG_BDS_B3_6X:
		code = "6X"

	case GNSS_SV_SIG_BDS_B3A_6D:
		code = "6D"
	case GNSS_SV_SIG_BDS_B3A_6P:
		code = "6P"
	case GNSS_SV_SIG_BDS_B3A_6Z:
		code = "6Z"
	}
	return
}

func GnssSvGpsSigId2Code(sigid byte) (code string) {
	switch sigid {
	// GPS
	// L1/1575.42
	case GNSS_SV_SIG_GPS_L1_1C:
		code = "1C"
	case GNSS_SV_SIG_GPS_L1_1S:
		code = "1S"
	case GNSS_SV_SIG_GPS_L1_1L:
		code = "1L"
	case GNSS_SV_SIG_GPS_L1_1X:
		code = "1X"
	case GNSS_SV_SIG_GPS_L1_1P:
		code = "1P"
	case GNSS_SV_SIG_GPS_L1_1W:
		code = "1W"
	case GNSS_SV_SIG_GPS_L1_1Y:
		code = "1Y"
	case GNSS_SV_SIG_GPS_L1_1M:
		code = "1M"
	case GNSS_SV_SIG_GPS_L1_1N:
		code = "1N"

	// L2/1227.60
	case GNSS_SV_SIG_GPS_L2_2C:
		code = "2C"
	case GNSS_SV_SIG_GPS_L2_2S:
		code = "2S"
	case GNSS_SV_SIG_GPS_L2_2L:
		code = "2L"
	case GNSS_SV_SIG_GPS_L2_2X:
		code = "2X"
	case GNSS_SV_SIG_GPS_L2_2P:
		code = "2P"
	case GNSS_SV_SIG_GPS_L2_2W:
		code = "2W"
	case GNSS_SV_SIG_GPS_L2_2Y:
		code = "2Y"
	case GNSS_SV_SIG_GPS_L2_2M:
		code = "2M"
	case GNSS_SV_SIG_GPS_L2_2N:
		code = "2N"

	// L5/1176.45
	case GNSS_SV_SIG_GPS_L5_5I:
		code = "5I"
	case GNSS_SV_SIG_GPS_L5_5Q:
		code = "5Q"
	case GNSS_SV_SIG_GPS_L5_5X:
		code = "5X"
	}
	return
}

func GnssSvGloSigId2Code(sigid byte) (code string) {
	switch sigid {
	// GLONASS
	// G1 1602+k*9/16 (k: code="" -7….+12)
	case GNSS_SV_SIG_GLO_G1_1C:
		code = "1C"
	case GNSS_SV_SIG_GLO_G1_1P:
		code = "1P"

	// G1a/  1600.995
	case GNSS_SV_SIG_GLO_G1a_4A:
		code = "4A"
	case GNSS_SV_SIG_GLO_G1a_4B:
		code = "4B"
	case GNSS_SV_SIG_GLO_G1a_4X:
		code = "4X"

	// G2 G2/ 1246+k*7/16
	case GNSS_SV_SIG_GLO_G2_2C:
		code = "2C"
	case GNSS_SV_SIG_GLO_G2_2P:
		code = "2P"

	// G2a/  1248.06
	case GNSS_SV_SIG_GLO_G2a_6A:
		code = "6A"
	case GNSS_SV_SIG_GLO_G2a_6B:
		code = "6B"
	case GNSS_SV_SIG_GLO_G2a_6X:
		code = "6X"

	// G3 / 1202.025
	case GNSS_SV_SIG_GLO_G3_3I:
		code = "3I"
	case GNSS_SV_SIG_GLO_G3_3Q:
		code = "3Q"
	case GNSS_SV_SIG_GLO_G3_3X:
		code = "3X"
	}
	return
}

func GnssSvGalSigId2Code(sigid byte) (code string) {
	switch sigid {
	// Galileo
	// E1 / 1575.42
	case GNSS_SV_SIG_GAL_E1_1A:
		code = "1A"
	case GNSS_SV_SIG_GAL_E1_1B:
		code = "1B"
	case GNSS_SV_SIG_GAL_E1_1C:
		code = "1C"
	case GNSS_SV_SIG_GAL_E1_1X:
		code = "1X"
	case GNSS_SV_SIG_GAL_E1_1Z:
		code = "1Z"

	// E5a / 1176.45
	case GNSS_SV_SIG_GAL_E5a_5I:
		code = "5I"
	case GNSS_SV_SIG_GAL_E5a_5Q:
		code = "5Q"
	case GNSS_SV_SIG_GAL_E5a_5X:
		code = "5X"

	// E5b / 1207.140
	case GNSS_SV_SIG_GAL_E5b_7I:
		code = "7I"
	case GNSS_SV_SIG_GAL_E5b_7Q:
		code = "7Q"
	case GNSS_SV_SIG_GAL_E5b_7X:
		code = "7X"

	// E5(E5a+E5b) /  1191.795
	case GNSS_SV_SIG_GAL_E5ab_8I:
		code = "8I"
	case GNSS_SV_SIG_GAL_E5ab_8Q:
		code = "8Q"
	case GNSS_SV_SIG_GAL_E5ab_8X:
		code = "8X"

	// E6 / 1278.75
	case GNSS_SV_SIG_GAL_E6_6A:
		code = "6A"
	case GNSS_SV_SIG_GAL_E6_6B:
		code = "6B"
	case GNSS_SV_SIG_GAL_E6_6C:
		code = "6C"
	case GNSS_SV_SIG_GAL_E6_6X:
		code = "6X"
	case GNSS_SV_SIG_GAL_E6_6Z:
		code = "6Z"
	}
	return
}

func GnssSvSbasSigId2Code(sigid byte) (code string) {
	switch sigid {
	// SBAS
	// L1 / 1575.42
	case GNSS_SV_SIG_SBAS_L1_1C:
		code = "1C"

	// L5 / 1176.45
	case GNSS_SV_SIG_SBAS_L5_5I:
		code = "5I"
	case GNSS_SV_SIG_SBAS_L5_5Q:
		code = "5Q"
	case GNSS_SV_SIG_SBAS_L5_5X:
		code = "5X"
	}
	return
}

func GnssSvQzssSigId2Code(sigid byte) (code string) {
	switch sigid {
	case GNSS_SV_SIG_QZS_L1_1C:
		code = "1C"
	case GNSS_SV_SIG_QZS_L1_1E:
		code = "1E"
	case GNSS_SV_SIG_QZS_L1_1S:
		code = "1S"
	case GNSS_SV_SIG_QZS_L1_1L:
		code = "1L"
	case GNSS_SV_SIG_QZS_L1_1X:
		code = "1X"
	case GNSS_SV_SIG_QZS_L1_1Z:
		code = "1Z"
	case GNSS_SV_SIG_QZS_L1_1B:
		code = "1B"

		// L2/1227.60
	case GNSS_SV_SIG_QZS_L2_2S:
		code = "2S"
	case GNSS_SV_SIG_QZS_L2_2L:
		code = "2L"
	case GNSS_SV_SIG_QZS_L2_2X:
		code = "2X"

		// L5/1176.45
	case GNSS_SV_SIG_QZS_L5_5I:
		code = "5I"
	case GNSS_SV_SIG_QZS_L5_5Q:
		code = "5Q"
	case GNSS_SV_SIG_QZS_L5_5X:
		code = "5X"
	case GNSS_SV_SIG_QZS_L5_5D:
		code = "5D"
	case GNSS_SV_SIG_QZS_L5_5P:
		code = "5P"
	case GNSS_SV_SIG_QZS_L5_5Z:
		code = "5Z"

		// L6 / 1278.75
	case GNSS_SV_SIG_QZS_L6_6S:
		code = "6D"
	case GNSS_SV_SIG_QZS_L6_6L:
		code = "6P"
	case GNSS_SV_SIG_QZS_L6_6X:
		code = "6X"
	case GNSS_SV_SIG_QZS_L6_6E:
		code = "6E"
	case GNSS_SV_SIG_QZS_L6_6Z:
		code = "6Z"
	}
	return
}

func GnssSvWlnavSigId2Code(sigid byte) (code string) {
	switch sigid {
	case GNSS_SV_SIG_WLNAV_L1_1I:
		code = "1I"
	case GNSS_SV_SIG_WLNAV_L1_1Q:
		code = "1Q"
	case GNSS_SV_SIG_WLNAV_L5_5I:
		code = "5I"
	case GNSS_SV_SIG_WLNAV_L5_5Q:
		code = "5Q"
	}
	return
}

func GnssSvSigId2Code(navisys byte, sigid byte) string {
	switch navisys {
	case SYS_BD:
		return GnssSvBDSSigId2Code(sigid)
	case SYS_GPS:
		return GnssSvGpsSigId2Code(sigid)
	case SYS_SBS:
		return GnssSvSbasSigId2Code(sigid)
	case SYS_GLO:
		return GnssSvGloSigId2Code(sigid)
	case SYS_GAL:
		return GnssSvGalSigId2Code(sigid)
	case SYS_QZS:
		return GnssSvQzssSigId2Code(sigid)
	case SYS_WLNAV:
		return GnssSvWlnavSigId2Code(sigid)
	}
	return ""
}

/*
*
 */
func GnssSvSigIdFromRangeSigId(navisys byte, signv byte) (freq float64, rval byte) {
	freq = 0
	rval = 0
	if navisys == SYS_GPS {
		switch signv {
		case 0:
			freq = GNSS_SV_FREQ_GPS_L1
			rval = GNSS_SV_SIG_GPS_L1_1C
		case 2:
			freq = GNSS_SV_FREQ_GPS_L5
			rval = GNSS_SV_SIG_GPS_L5_5Q
		case 3:
			freq = GNSS_SV_FREQ_GPS_L1
			rval = GNSS_SV_SIG_GPS_L1_1L
		case 5:
			freq = GNSS_SV_FREQ_GPS_L2
			rval = GNSS_SV_SIG_GPS_L2_2P
		case 6:
			freq = GNSS_SV_FREQ_GPS_L5
			rval = GNSS_SV_SIG_GPS_L5_5Q
		case 9:
			freq = GNSS_SV_FREQ_GPS_L2
			rval = GNSS_SV_SIG_GPS_L2_2W
		case 14:
			freq = GNSS_SV_FREQ_GPS_L5
			rval = GNSS_SV_SIG_GPS_L5_5X
		case 17:
			freq = GNSS_SV_FREQ_GPS_L2
			rval = GNSS_SV_SIG_GPS_L2_2S
		}
	} else if navisys == SYS_BD {
		switch signv {
		case 0:
			freq = GNSS_SV_FREQ_BDS_B1
			rval = GNSS_SV_SIG_BDS_B1_2I
		case 17:
			freq = GNSS_SV_FREQ_BDS_B2
			rval = GNSS_SV_SIG_BDS_B2_7I
		case 2:
			freq = GNSS_SV_FREQ_BDS_B3
			rval = GNSS_SV_SIG_BDS_B3_6I
		case 8: // unicore range   B1C(Pilot)
			freq = GNSS_SV_FREQ_BDS_B1C
			rval = GNSS_SV_SIG_BDS_B1C_1P
		case 12: // unicore range   B2a(Pilot)
			freq = GNSS_SV_FREQ_BDS_B2a
			rval = GNSS_SV_SIG_BDS_B2a_5P
		case 21: // unicore range B3I
			freq = GNSS_SV_FREQ_BDS_B3
			rval = GNSS_SV_SIG_BDS_B3_6I
		case 23: // unicore range   B1C(Data)
			freq = GNSS_SV_FREQ_BDS_B1C
			rval = GNSS_SV_SIG_BDS_B1C_1D
		case 28: // unicore range   B2a(Data)
			freq = GNSS_SV_FREQ_BDS_B2a
			rval = GNSS_SV_SIG_BDS_B2a_5D

		}
	} else if navisys == SYS_GLO {
		switch signv {
		case 0:
			freq = GNSS_SV_FREQ_GLO_G1
			rval = GNSS_SV_SIG_GLO_G1_1C
		case 1:
			freq = GNSS_SV_FREQ_GLO_G2
			rval = GNSS_SV_SIG_GLO_G2_2C
		case 5:
			freq = GNSS_SV_FREQ_GLO_G2
			rval = GNSS_SV_SIG_GLO_G2_2P
		}
	} else if navisys == SYS_SBS {
		switch signv {
		case 0:
			freq = GNSS_SV_FREQ_SBAS_L1
			rval = GNSS_SV_SIG_SBAS_L1_1C
		case 6:
			freq = GNSS_SV_FREQ_SBAS_L5
			rval = GNSS_SV_SIG_SBAS_L5_5I
		}
	} else if navisys == SYS_GAL {
		switch signv {
		case 2: // zjy
			freq = GNSS_SV_FREQ_GAL_E1
			rval = GNSS_SV_SIG_GAL_E1_1C
		case 12: // zjy
			freq = GNSS_SV_FREQ_GAL_E5a
			rval = GNSS_SV_SIG_GAL_E5a_5Q
		case 17: // zjy
			freq = GNSS_SV_FREQ_GAL_E5b
			rval = GNSS_SV_SIG_GAL_E5b_7Q
		}
	}
	return
}
